package com.hnust.aopdemo.service;

import com.hnust.aopdemo.security.CurrentUserHolder;
import org.springframework.stereotype.Service;

@Service
public class AuthService {
    public void checkAccess() {
        String user = CurrentUserHolder.getHolder();
        if (!"admin".equals(user)) {
            throw new RuntimeException("operation not allow");
        }
    }
}
